/**
 * 
 */
package com.toncen.samepms.tree;

import java.util.List;

import com.toncen.samepms.basic.dao.OrganizationDao;
import com.toncen.samepms.basic.domain.Organization;
import com.toncen.samepms.common.AbstractTreeProvider;

/**
 * @author tch
 * 
 */
public class OrganizationTreeProvider extends AbstractTreeProvider<Organization> {

	/**
	 * 
	 */
	public OrganizationTreeProvider() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.toncen.samepms.common.AbstractTree#getRoots()
	 */
	public List<Organization> getRoots() throws Exception {
		OrganizationDao organizationDao = new OrganizationDao();
		return organizationDao.getAllRootOrganization();
	}

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		OrganizationTreeProvider moduleTree = new OrganizationTreeProvider();
		System.out.println(moduleTree.getRoots());
	}

}
